<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>&lt;iframe&gt; test</title>
  </head>
  <body>
    <div id="test"></div>
    <script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js"></script>
    <script type="text/javascript">
      $(document).ready(function() {
        /*$('#bucket').append('<iframe id="test"></iframe>');
        setTimeout(function() {
          var iframe_body = $('#test').contents().find('body');
          //iframe_body.append('<scr' + 'ipt type="text/javascript" src="iframe_test.js"></scr' + 'ipt>');
          	iframe_body.append('<scr' + 'ipt type="text/javascript" src="http://yui.yahooapis.com/3.13.0/build/yui/yui-min.js"></scr' + 'ipt>');
          	setTimeout(function() {
          	iframe_body.append('<scr' + 'ipt type="text/javascript" src="q2.js"></scr' + 'ipt>');          		
          	}, 2000);
          	iframe_body.append('<div><header><h1>Match The City With The Country</h1></header><nav><p><div id="play"><ul id="list1"><li class="list1" data="d1">Kyiv</li><li class="list1" data="d2">Oslo</li><li class="list1" data="d3">New Delhi</li><li class="list1" data="d4">Chisinau</li><li class="list1" data="d5">Lusaka</li></ul><ul id="list2"><li class="list2" data="d1">Ukraine</li><li class="list2" data="d5">Zambia</li><li class="list2" data="d2">Norway</li><li class="list2" data="d3">India</li><li class="list2" data="d4">Moldova</li></ul></div></p><button id="check">check</button><p><label id="resultLBL"></label></p></nav><div></div><footer><p>&copy; Copyright  by nnimova</p></footer></div>');
          }, 100);*/
         var iframe = document.createElement('iframe');
         
         var bucket = document.getElementById('test');
      	 bucket.appendChild(iframe);
      	 
      	 var val = '<scr' + 'ipt type="text/javascript" src="http://yui.yahooapis.com/3.13.0/build/yui/yui-min.js"></scr' + 'ipt>';
      	 val += '<scr' + 'ipt type="text/javascript" src="q2.js"></scr' + 'ipt>';
      	 val += '<div><header><h1>Match The City With The Country</h1></header><nav><p><div id="play"><ul id="list1"><li class="list1" data="d1">Kyiv</li><li class="list1" data="d2">Oslo</li><li class="list1" data="d3">New Delhi</li><li class="list1" data="d4">Chisinau</li><li class="list1" data="d5">Lusaka</li></ul><ul id="list2"><li class="list2" data="d1">Ukraine</li><li class="list2" data="d5">Zambia</li><li class="list2" data="d2">Norway</li><li class="list2" data="d3">India</li><li class="list2" data="d4">Moldova</li></ul></div></p><button id="check">check</button><p><label id="resultLBL"></label></p></nav><div></div><footer><p>&copy; Copyright  by nnimova</p></footer></div>';
      	 
      	 var doc = iframe.contentWindow || iframe.contentDocument;
	      if (doc.document) {
	        doc = doc.document;
	      }
	
	      // open, write content to, and close the document
	      doc.open();
	      doc.write(val);
	      doc.close();
	   });
</script>
  </body>
</html>